package main

func main() {

}

type pathTreeNode struct {
	val   int
	left  *pathTreeNode
	right *pathTreeNode
}

func getPathAllSum(root *pathTreeNode, parent int) int {
	if root == nil {
		return 0
	}
	if root.left == nil && root.right == nil {
		return parent*10 + root.val
	}
	return getPathAllSum(root.left, parent*10+root.val) + getPathAllSum(root.right, parent*10+root.val)

}
